package com.ruoyi.cp.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.cp.mapper.VipLinkMapper;
import com.ruoyi.cp.domain.VipLink;
import com.ruoyi.cp.service.IVipLinkService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;

/**
 * 开通会员线下联系方式 服务层实现
 * 
 * @author wh
 * @date 2019-06-25
 */
@Slf4j
@Service
public class VipLinkServiceImpl extends ServiceImpl<VipLinkMapper, VipLink> implements IVipLinkService {

    @Override
    public List<VipLink> list(VipLink vipLink){
        LambdaQueryWrapper<VipLink> wrapper = new LambdaQueryWrapper<>();
        if(vipLink != null){
            if(StringUtils.isNotEmpty(vipLink.getId())){
                wrapper.eq(VipLink::getId, vipLink.getId());
            }
            if(StringUtils.isNotEmpty(vipLink.getQrcode())){
                wrapper.eq(VipLink::getQrcode, vipLink.getQrcode());
            }
            if(StringUtils.isNotEmpty(vipLink.getContent())){
                wrapper.eq(VipLink::getContent, vipLink.getContent());
            }
        }
        return baseMapper.selectList(wrapper);
    }
}
